package cn.edu.swu.book;

import java.util.Date;

public class Book {
    private int id = -1;
    private String name;
    private String author;
    private double price;
    private String memo;
    private Date publish;
    private String image;

    public Book(){}

    public Book(int id, String name, String author, double price, String memo, Date publish, String image) {
        this.setId(id);
        this.setName(name);
        this.setAuthor(author);
        this.setPrice(price);
        this.setMemo(memo);
        this.setPublish(publish);
        this.setImage(image);
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public Date getPublish() {
        return publish;
    }

    public void setPublish(Date publish) {
        this.publish = publish;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getImage(){
        return this.image;
    }

    public String toString() {
        return String.format("%s, %s, %s, %s, %s, %s, %s",
                this.getId(), this.getName(), this.getAuthor(),
                this.getPrice(), this.getMemo(),
                this.getPublish(), this.getImage());
    }
}
